function fig4_13

nt=100;
tmax=120;
t=linspace(0,tmax,nt);

clf
% get(gcf)
set(gcf,'Position', [25 1115 658 230])
co = [0 0 1;
    0 0.5 0;
    1 0 0;
    0 0.75 0.75;
    0.75 0 0.75;
    0.75 0.75 0;
    0.25 0.25 0.25];
set(groot,'defaultAxesColorOrder',co)
subaxis(1,1,1,1,'MT',0.01,'MB',0.18,'MR',-0.015,'ML',0.065,'P',0.04)

ep=0.1;
for it=1:nt
	k=2+cos(ep*t(it));
	ya(it)=1/sqrt(3*k);
end

%  initial values

y10=0; y20=1; 
y0=[y10 y20];

%  calculate solution using a MATLAB routine
[tt,y] = ode45(@rhs,[0 tmax],y0);  titleX='ode45';
%[t,y] = ode23s(@rhs,[0 tmax],y0);  titleX='ode23s';

hold on
box on
grid on

plot(t,ya,'r','Linewidth',1.2)
plot(tt,y(:,1),'b','Linewidth',1.2)

axis([0 tmax -0.601 0.6])
set(gca,'ytick',[-0.5 0 0.5])
set(gca,'YTickLabel',{'$-0.5$';'0';'0.5'})

ax = gca;
ax.XAxis.TickLabelInterpreter = 'latex';
ax.YAxis.TickLabelInterpreter = 'latex';
set(gca,'FontSize',13)

xlabel('$t$\,-\,axis','Interpreter','latex','FontSize',14)
ylabel('Solution','Interpreter','latex','FontSize',14)


%exportgraphics(gcf,'/Users/mark/Desktop/fig33.pdf')

%  define f(t,y)
function dy=rhs(t,y)
dy=zeros(2,1);
ep=0.1; 
k=2+cos(ep*t);
dy(1) = y(2);
dy(2) = -k*k*y(1);







